package com.wl.mall.service.seckill.controller;

import com.wl.mall.api.seckill.entity.SeckillActivity;
import com.wl.mall.service.seckill.service.SeckillActivityService;
import com.wl.mall.util.common.entity.RespResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/activity")
public class SeckillActivityController {


    @Resource
    private SeckillActivityService seckillActivityService;
    /***
     * 未过期的活动列表
     */
    @GetMapping
    public RespResult<List<SeckillActivity>> list(){
        //有效的活动时间查询
        List<SeckillActivity> list = seckillActivityService.validActivity();
        return RespResult.ok(list);
    }
}
